package com.kalvan.admin.system.controller;

import com.kalvan.web.dict.CacheUtil;
import com.kalvan.web.servlet.response.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 公用接口
 *
 * @author kalvan
 * @date: 2020/7/26
 **/
@RestController
@RequestMapping("common")
public class CommonController {

    @ApiOperation(value = "获取数据字典", notes = "获取数据字典", response = R.class)
    @GetMapping("getDictValue/{dictType}")
    public R getDictValue(@PathVariable("dictType") String dictType) {
        return R.ok().putData(CacheUtil.getCache().getDictMap(dictType));
    }

}
